///@file Node.h
///@brief Declaration of the class representing a mesh Node
///@author Arnaud Duval
///@version 0.0
///@date 2009/10/29


#ifndef NODE_H
#define NODE_H

#include <assert.h>
#include <iostream>

///@class Node
///@brief class defining a mesh node
///A node is defined by its coordinates and its reference
class Node
{
	private:
		///@brief spatial coordinates
		double *coords;
		///@brief dimension
		unsigned int dim;
		///@brief reference
		std::string reference;
	public:
		///@brief Default constructor
		Node();
		///@brief Constructor with a predefined dimension
		Node(int);
		///@brief Copy constructor
		Node(const Node&);
		///@brief Copy constructor for temporary objects
		Node(Node*);
		///@brief Destructor
		~Node();
		///@brief Direct access to reference
		std::string& Reference();
		///@brief Return dimension of node coordinates
		int Dim();
		///@brief Set dimension of coordinates array
		void SetDimension(unsigned int);
		///@brief Set a given coordinate
		void SetCoordinate(unsigned int, double);
        ///@brief Return a given coordinate
        double GetCoordinate(unsigned int);
		///@brief Overload of [] operator : direct access to a coordinates
		double& operator[] (unsigned int);
		///@brief Overload of = operator
		Node& operator= (const Node);
		///@brief Overload of = operator for temporary objects
		Node& operator= (Node*);
        ///@brief Return number of DOF of the node
        unsigned int GetNumberOfDOF();

		///@brief Compute distance between 2 nodes
		friend double Distance(const Node&, const Node&);

		///@brief Overload of << operator
		friend std::ostream& operator<<(std::ostream&, Node&);
};



#endif